Skip to content

Comments

Sync: Ripple(d) 2.4.0#520

Open
tequdev wants to merge 350 commits intodevfrom
sync-2.4.0
Open

Sync: Ripple(d) 2.4.0#520
tequdev wants to merge 350 commits intodevfrom
sync-2.4.0

Conversation

@tequdev
Copy link
Member

@tequdev tequdev commented Jun 20, 2025

High Level Overview of Change

Context of Change

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Tests (you added tests for code that already exists, or your new feature included in this PR)
  • Documentation update
  • Chore (no impact to binary, e.g. .gitignore, formatting, dropping support for older tooling)
  • Release

API Impact

  • Public API: New feature (new methods and/or new fields)
  • Public API: Breaking change (in general, breaking changes should only impact the next api_version)
  • libxrpl change (any change that may affect libxrpl or dependents of libxrpl)
  • Peer protocol change (must be backward compatible or bump the peer protocol version)

New Amendments

  • featureDeepFreeze

  • featurePermissionedDomains

  • featureDynamicNFT

  • featureCredentials

  • featureAMMClawback

  • featureMPTokensV1

  • featureInvariantsV1_1

  • featureNFTokenMintOffer

  • featurePriceOracle

  • featureDID

    • fixEmptyDID
  • featureXChainBridge

    • fixXChainRewardRounding
  • featureAMM

    • fixAMMv1_1
    • fixAMMv1_2
    • fixAMMOverflowOffer
    • fixFrozenLPTokenTransfer
  • featureClawback

  • fixNFTokenPageLinks

  • fixEnforceNFTokenTrustline

  • fixReducedOffersV1

    • fixReducedOffersV2
  • fixPreviousTxnID

  • fixInnerObjTemplate

    • fixInnerObjTemplate2
  • fixNFTokenReserve

  • fixFillOrKill

  • fixDisallowIncomingV1

1.12.0
2.0.0, 2.0.1
2.1.0, 2.1.1
2.2.0~2.2.3

2.2.1

2.2.2

2.2.3

2.3.0, 2.3.1

2.3.0

2.3.1

2.4.0

mvadari and others added 30 commits June 17, 2025 12:32
Add a new RPC / WS call for `server_definitions`, which returns an
SDK-compatible `definitions.json` (binary enum definitions) generated by
the server. This enables clients/libraries to dynamically work with new
fields and features, such as ones that may become available on side
chains. Clients query `server_definitions` on a node from the network
they want to work with, and immediately know how to speak that node's
binary "language", even if new features are added to it in the future
(as long as there are no new serialized types that the software doesn't
know how to serialize/deserialize).

Example:

```js
> {"command": "server_definitions"}
< {
    "result": {
        "FIELDS": [
            [
                "Generic",
                {
                    "isSerialized": false,
                    "isSigningField": false,
                    "isVLEncoded": false,
                    "nth": 0,
                    "type": "Unknown"
                }
            ],
            [
                "Invalid",
                {
                    "isSerialized": false,
                    "isSigningField": false,
                    "isVLEncoded": false,
                    "nth": -1,
                    "type": "Unknown"
                }
            ],
            [
                "ObjectEndMarker",
                {
                    "isSerialized": false,
                    "isSigningField": true,
                    "isVLEncoded": false,
                    "nth": 1,
                    "type": "STObject"
                }
            ],
        ...
```

Close #3657

---------

Co-authored-by: Richard Holland <richard.holland@starstone.co.nz>
Implement native support for Price Oracles.

 A Price Oracle is used to bring real-world data, such as market prices,
 onto the blockchain, enabling dApps to access and utilize information
 that resides outside the blockchain.

 Add Price Oracle functionality:
 - OracleSet: create or update the Oracle object
 - OracleDelete: delete the Oracle object

 To support this functionality add:
 - New RPC method, `get_aggregate_price`, to calculate aggregate price for a token pair of the specified oracles
 - `ltOracle` object

 The `ltOracle` object maintains:
 - Oracle Owner's account
 - Oracle's metadata
 - Up to ten token pairs with the scaled price
 - The last update time the token pairs were updated

 Add Oracle unit-tests
The compilation fails due to an issue in the initializer list
of an optional argument, which holds a vector of pairs.
The code compiles correctly on earlier gcc versions, but fails on gcc 13.
* It is now an invariant that all constructed Public Keys are valid,
  non-empty and contain 33 bytes of data.
* Additionally, the memory footprint of the PublicKey class is reduced.
  The size_ data member is declared as static.
* Distinguish and identify the PublisherList retrieved from the local
  config file, versus the ones obtained from other validators.
* Fixes #2942
This algorithm is about an order of magnitude faster than the existing
algorithm (about 10x faster for encoding and about 15x faster for
decoding - including the double hash for the checksum). The algorithms
use gcc's int128 (fast MS version will have to wait, in the meantime MS
falls back to the slow code).
* uses same formatting as admin RPC
* hides potentially sensitive data
This is likely the result of a typo when the code was simplified.
Fixes some mistakes in #4885
…#4893)

We are currently using old version 0.6.2 of `xxhash`, as a verbatim copy and paste of its header file `xxhash.h`. Switch to the more recent version 0.8.2. Since this version is in Conan Center (and properly protects its ABI by keeping the state object incomplete), add it as a Conan requirement. Switch to the SIMD instructions (in the new `XXH3` family) supported by the new version.
* telENV_RPC_FAILED is a new code, reserved exclusively
  for unit tests when RPC fails. This will
  make those types of errors distinct and easier to test
  for when expected and/or diagnose when not.
* Output RPC command result when result is not expected.
This amendment fixes an edge case where an empty DID object can be
created. It adds an additional check to ensure that DIDs are
non-empty when created, and returns a `tecEMPTY_DID` error if the DID
would be empty.
We do not currently enforce that incoming peer connection does not have
remote_endpoint which is already used (either by incoming or outgoing
connection), hence already stored in slots_. If we happen to receive a
connection from such a duplicate remote_endpoint, it will eventually result in a
crash (when disconnecting) or weird behavior (when updating slot state), as a
result of an apparently matching remote_endpoint in slots_ being used by a
different connection.
This fixes a case where a peer can desync under a certain timing
circumstance--if it reaches a certain point in consensus before it receives
proposals. 

This was noticed under high transaction volumes. Namely, when we arrive at the
point of deciding whether consensus is reached after minimum establish phase
duration but before having received any proposals. This could be caused by
finishing the previous round slightly faster and/or having some delay in
receiving proposals. Existing behavior arrives at consensus immediately after
the minimum establish duration with no proposals. This causes us to desync
because we then close a non-validated ledger. The change in this PR causes us to
wait for a configured threshold before making the decision to arrive at
consensus with no proposals. This allows validators to catch up and for brief
delays in receiving proposals to be absorbed. There should be no drawback since,
with no proposals coming in, we needn't be in a huge rush to jump ahead.
When calculating reward shares, the amount should always be rounded
down. If the `fixUniversalNumber` amendment is not active, this works
correctly. If it is not active, then the amount is incorrectly rounded
up. This patch introduces an amendment so it will be rounded down.
* master is the default branch for that project. There's no point in
  using develop.
This amendment, `fixPreviousTxnID`, adds `PreviousTxnID` and
`PreviousTxnLgrSequence` as fields to all ledger objects that did
not already have them included (`DirectoryNode`, `Amendments`,
`FeeSettings`, `NegativeUNL`, and `AMM`). This makes it much easier
to go through the history of these ledger objects.
---------

Co-authored-by: Howard Hinnant <howard.hinnant@gmail.com>
Co-authored-by: Mark Travis <mtravis@ripple.com>
Co-authored-by: Bronek Kozicki <brok@incorrekt.com>
Co-authored-by: Mayukha Vadari <mvadari@gmail.com>
Co-authored-by: Chenna Keshava <ckeshavabs@gmail.com>
---------

Co-authored-by: Howard Hinnant <howard.hinnant@gmail.com>
Co-authored-by: Mark Travis <mtravis@ripple.com>
Co-authored-by: Bronek Kozicki <brok@incorrekt.com>
Co-authored-by: Mayukha Vadari <mvadari@gmail.com>
Co-authored-by: Chenna Keshava <ckeshavabs@gmail.com>
The `rotateWithLock` function holds a lock while it calls a callback
function that's passed in by the caller. This is a problematic design
that needs to be used very carefully. In this case, at least one caller
passed in a callback that eventually relocks the mutex on the same
thread, causing UB (a deadlock was observed). The caller was from
SHAMapStoreImpl, and it called `clearCaches`. This `clearCaches` can
potentially call `fetchNodeObject`, which tried to relock the mutex.

This patch resolves the issue by changing the mutex type to a
`recursive_mutex`. Ideally, the code should be rewritten so it doesn't
hold the mutex during the callback and the mutex should be changed back
to a regular mutex.

Co-authored-by: Ed Hennis <ed@ripple.com>
@tequdev
Copy link
Member Author

tequdev commented Nov 25, 2025

TODO: update get_stobject_length to support new SerializedTypeIDs

STI_ISSUE(24)
STI_XCHAIN_BRIDGE(25)
STI_CURRENCY(26)

@tequdev tequdev mentioned this pull request Dec 17, 2025
12 tasks
@dangell7
Copy link
Collaborator

dangell7 commented Jan 5, 2026

bump

@tequdev tequdev changed the title Sync: Ripple(d) 2.4.0 [DO NOT MERGE] Sync: Ripple(d) 2.4.0 Jan 6, 2026
@tequdev
Copy link
Member Author

tequdev commented Jan 6, 2026

This PR is ready for review.

tequdev and others added 16 commits January 6, 2026 23:18
* Hook API Refactor2: Amendment Guards (#621)

* Hook API Refactor3: Consolidate the Hook API definitions from Enum.h and ApplyHook.h into a single file. (#622)

* Hook API Refactoring / Unit Testing (#581)

* Hook API Refactor2: Amendment Guards (#621)

* Hook API Refactor3: Consolidate the Hook API definitions from Enum.h and ApplyHook.h into a single file. (#622)

* Hook API Refactoring / Unit Testing (#581)

* fix: update clang-format to v18 and fix include ordering

- Update verify-generated-headers CI to use clang-format 18 (matching
  clang-format.yml) instead of stale v10 which can't parse .clang-format
- Add .mise.toml for local clang-format 18 tooling
- Fix include ordering in cherry-picked files per clang-format 18

* chore: update levelization results for HookAPI changes

New loop: xrpl.hook <-> xrpld.app due to HookAPI.h including
Transaction.h from xrpld.app.

---------

Co-authored-by: tequ <git@tequ.dev>
* Hook API Refactor2: Amendment Guards (#621)

* Hook API Refactor3: Consolidate the Hook API definitions from Enum.h and ApplyHook.h into a single file. (#622)

* Hook API Refactoring / Unit Testing (#581)

* fix `Xahau Ledger` to `Xahau Network` (#651)

* Add GitHub Actions workflow for Guard Checker Build (#658)

* fix `Xahau Ledger` to `Xahau Network` (#651)

* Add GitHub Actions workflow for Guard Checker Build (#658)

* fix: update guard checker build path for directory restructure

* fix: update stale ripple include paths in hook headers

* fix(test): avoid deleted PublicKey default ctor in HookAPI test

* chore(levelization): update ordering after hook/protocol dependency change

---------

Co-authored-by: tequ <git@tequ.dev>
# Conflicts:
#	.github/workflows/guard-checker-build.yml
#	.github/workflows/verify-generated-headers.yml
#	Builds/CMake/RippledCore.cmake
#	hook/generate_extern.sh
#	hook/sfcodes.h
#	include/xrpl/basics/Expected.h
#	include/xrpl/hook/Enum.h
#	include/xrpl/hook/HookAPI.h
#	include/xrpl/hook/hook_api.macro
#	include/xrpl/protocol/Feature.h
#	include/xrpl/protocol/jss.h
#	src/libxrpl/protocol/Feature.cpp
#	src/ripple/protocol/SField.h
#	src/ripple/protocol/impl/LedgerFormats.cpp
#	src/ripple/protocol/impl/SField.cpp
#	src/test/app/HookAPI_test.cpp
#	src/test/jtx/hook.h
#	src/test/jtx/impl/hook.cpp
#	src/xrpld/app/hook/applyHook.h
#	src/xrpld/app/hook/detail/HookAPI.cpp
#	src/xrpld/app/hook/detail/applyHook.cpp
#	src/xrpld/app/tx/detail/Change.cpp
…2.4.0

# Conflicts:
#	include/xrpl/protocol/Feature.h
#	src/test/app/SetHook_wasm.h
- Add missing getHookOn declaration and implementation (build blocker)
- Add else branches for HookOnOutgoing/HookOnIncoming in hsoUPDATE path
- Guard unprotected optional dereferences in hsoINSTALL path
- Reorder features.macro per review (HookOnV2/HooksUpdate2 before fixHookAPI20251128)
Merge dev (67a6970) into sync-2.4.0: HookOnV2 + prepare API
…3e8039c5

# Conflicts:
#	BUILD.md
#	cfg/xahaud-example.cfg
#	src/xrpld/app/tx/detail/Change.cpp
Merge dev (c3e8039) into sync-2.4.0: fixXahauGenesisOwnerCount + docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ripple(d) sync Sync w/ RIpple(d)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PreviousTxnLgrSeq and PreviousTxnID missing from HookState objects Add API Version 2 support